import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'

Vue.use(Vuex)

// 应用初始状态
const state = {
    currentMenu: { ID: 5, PageUrl: '/home/ordertest', MenuName: '入库单测试', ParentID: 1, IconClass: 'edit-icon', IconUrl: '' },
    orgInfo:[]//当前用户所关联的组织机构信息及资源权限信息
}

// 定义所需的 mutations
const mutations = {

    SETCURRENTMENU(state, menu) {
        state.currentMenu = menu
    }
}

// 创建 store 实例
export default new Vuex.Store({
    actions,
    getters,
    state,
    mutations
})